package guoanmaker.operator.business.model;


import java.io.Serializable;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonManagedReference;

import guoanmaker.operator.helper.common.abstractobj.IdEntity;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name="t_provide_commodity")
public class ProvideCommodity extends IdEntity implements Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String commodityName; //商品名称
	private String isBargaining; //是否议价 1:议价 2:不可议价
	private Double startingPrice; //议价起始值
	private String invoiceMail;//发票邮寄 1：包邮 2：货到付款
	private String isTerritoryRestriction;//是否有地域限制 1:有 2:没有
	private Integer isPromotion;//是否促销 1:促销 2:不促销
	private Integer commodityCode;//商品编号
	
	private Double commodityPrice; //商品现价
	private Double commodityPricePromotion;//商品促销价
	private Date startTime;//商品促销开始时间
	private Date endTime;//商品促销结束时间
	private String commodity_bigimage;//商品大图
	private String commodity_smallimage;//商品小图
	private String description;//图文描述
	private Integer commodityState;//商品状态 1:待审核 2:审核通过 3:审核失败 4:下架 5:冻结 6:删除状态
	private Date createTime; //创建时间
	private String createName;//创建人
	private Date releaseTime;//发布时间
	private Integer stock;//商品库存
	private Integer populationRestriction;//人数限制
	private Date registrationStartTime;//报名开始时间
	private Date registrationEndTime;//报名结束时间
	private String synopsis;//商品简介
	private String type;//商品所属大类//1空间 2 普通的 3 培训
	private Integer clickRate;//点击量
	private String introduce;//介绍
	private String process;//流程
	private String promise;//承诺
	private String commodityCase;//案例
	private String auditOpinion;//审核意见
	private Double finalPrice;//最终价格

	private String reasonName;     //拒绝原因（存名称）
	private Date refuseTime;  //拒绝时间

    
    private String reasoncontent; //审批内容
	
	private Integer salesVolume;//商品销售量
	
	private Integer readState; //阅读状态 1:已阅读 2:未阅读

	@OneToOne
	private OperatorServerClass serviceType;//服务类别
	
	@ManyToOne(fetch=FetchType.EAGER,optional=true)
	@JoinColumn(name="business_id")
	private ProviderBusiness providerBusiness;
	
	
	@OneToMany(mappedBy="commodity",fetch=FetchType.LAZY,cascade={CascadeType.ALL})
	private List<ProvideCommodityServiceRange> serviceRange;


	@OneToOne
	private PerviderDictionary measurementUnit;;//计量单位

	

	
	
	@OneToMany(mappedBy="commodity",fetch=FetchType.LAZY,cascade={CascadeType.ALL})
	@JSONField(serialize=false)
	private List<ProvideOrderForm> orderforms;
	

}
